home *** CD-ROM | disk | FTP | other *** search
/ Family Forum 261 / SOMC Family Forum 261.iso / Xtras / Behavior Library.cst / 00004_Script_Go to Marker < prev    next >
Text File  |  1997-11-17  |  2KB  |  65 lines

  1. -- Marker  Go to/Play Marker
  2.  
  3. -- nav
  4. -- behavior library version 1.1
  5. -- drag to a sprite 
  6.  
  7. -- Allows author to assign which event will cause the 'go to label' action
  8. -- drag to sprite
  9. -- also functions through lingo by handling message 'initGotoMarker', 
  10. -- for example if this behavior was assigned to sprite 5, use
  11. -- sendsprite 5, #initGotoMarker
  12.  
  13. property  whichEvent, whichLabel,playmode
  14.  
  15. on initGotoMarker me
  16.   init me
  17. end
  18.  
  19. on mouseUp me
  20.   if whichEvent = #mouseup    then init me
  21. end
  22.  
  23. on prepareFrame me
  24.   if whichEvent = #prepareframe then init me
  25. end
  26.  
  27. on exitFrame me
  28.   if whichEvent = #exitframe  then init me
  29. end
  30.  
  31. on init me
  32.   if the playmode of me = #"Go to" then
  33.     case ( whichLabel ) of:
  34.       #Previous: go to marker( -1 )
  35.       #Loop:     go to marker(  0 )
  36.       #Next:     go to marker(  1 )
  37.       otherwise:
  38.         go to whichLabel    
  39.     end case
  40.   else
  41.     case ( whichLabel ) of:
  42.       #Previous: play marker( -1 )
  43.       #Loop:     play marker(  0 )
  44.       #Next:     play marker(  1 )
  45.       otherwise:
  46.         play whichLabel    
  47.     end case
  48.   end if
  49.   
  50. end
  51.  
  52.  
  53.  
  54.  
  55. ---
  56.  
  57. on getPropertyDescriptionList
  58.   set p_list = [     #WhichLabel: [ #comment:   "Destination Marker:",                     #format:   #marker,                    #default:  "#Loop" ],     #WhichEvent: [ #comment:   "Initializing Event:",                     #format:   #symbol,                      #range: [ #MouseUp, #PrepareFrame, #ExitFrame, #InitGotoMarker],                    #default:   #MouseUp ],       #playMode: [ #comment:   "Play Mode:",                     #format:   #symbol,                      #range: [ #"Go to", #"Play and Return" ],                    #default:   #"Go to" ]   ]
  59.   return p_list
  60. end
  61.  
  62. on getBehaviorDescription
  63.   return "Moves the Playback Head to a designated marker when the specified event occurs.  Drag to a sprite or a frame in the script channel." && RETURN & "PARAMETERS:" && RETURN & "ò Destination Marker - Choose from a list of all marker names in the current movie or choose Previous, Loop (Current), or Next."  && RETURN & "ò Initializing Event - Specify the event that triggers the behavior." & RETURN & "ò Play Mode - Choose Play and Return to make the Playback Head return to the current location when the Play Done behavior is encountered. Choose Go To to make the Playback Head continue from the specified frame until explicitly sent to a new location." 
  64. end
  65.